package com.tanhua.model.vo;

import com.tanhua.model.mongo.TestPaper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PaperVo implements Serializable {
    private String id;    //问卷id
    private String name;   //问卷名称
    private String cover;  //问卷封面
    private String level;  //问卷水平，初中高
    private Integer star;    //问卷星级，2-5
    private Integer isLock = 0; //是否被锁，0解锁，1锁住

    private String reportId; //最新报告



    public static PaperVo init(TestPaper testPaper){
        PaperVo vo=new PaperVo();

        BeanUtils.copyProperties(testPaper, vo);
        vo.setId(testPaper.getId().toHexString());

        return vo;
    }
}
